<%-- 
    Document   : listCorporateCustomer
    Created on : Dec 24, 2013, 6:32:11 PM
    Author     : santosh
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <%@include file="../common/script.jsp" %>
        <%@include file="../common/title.jsp" %>
        <script type="text/javascript">
            var rules=new Array();
            rules[0]='paymentTypeId|required|Select corporate';
            
            function excelDownload(){
                document.getElementById("excelDownload").value=1;
            }
        </script>
    </head>
    <body onload="yav.init('form1', rules,'inline');">
        <%@include file="../common/header.jsp" %>
        <%@include file="../common/menu.jsp" %>

        <div class="in_02">
            <%@include file="../common/message.jsp" %>

            <form id="form1" name="form1" method="post" action="corporateCustomerExcel.htm">
                <fieldset style="width: 500px; height: 85px">
                    <legend>Select options</legend>
                    <table class="formTable">
                        <tr><input type="hidden" id="excelDownload" name="excelDownload" value="${excelDownload}"/>
                        <td>Customer Name:<br/>
                            <input id="customerName" name="customerName" value="${customerName}" class="userInputMedium"/>
                        </td>
                        <td>Corporate:<br/><select id="paymentTypeId" name="paymentTypeId" class="userInputMedium">
                                <option value="">-</option>
                                <c:forEach items="${paymentTypeList}" var="item">
                                    <option <c:if test="${paymentTypeId==item.paymentTypeId}">selected</c:if> value="${item.paymentTypeId}">
                                        ${item.paymentTypeName}
                                    </option>
                                </c:forEach>
                            </select><br/><span id="errorsDiv_paymentTypeId"></span>
                        </td>
                        <td><br/><input  type="submit" value="Go" name="Go" onclick="return yav.performCheck('form1', rules, 'inline');" /></td>
                        </tr>
                    </table>
                </fieldset>
            </form>
            <br/><br/>
            <div style="float: left;">
                &nbsp;&nbsp;&nbsp;<strong style="margin:0 100px 0 0"><spring:message code="title.listCorporateCustomer"/></strong>
                <br/><br/>
                &nbsp;&nbsp;&nbsp;<c:out value="${fn:length(listCorporateData)}"/> <spring:message code="rowsFound"/>
                <div style="float: right;padding-right: 50Px;margin-top: -30px;">
                    <a href="#" onclick="if(yav.performCheck('form1', rules, 'inline')==true){ excelDownload(); document.form1.submit();}">
                        <img src="../images/Excel.png" alt="Download excel file" border="0" />
                    </a>
                </div>
                <table class="data_table" border="1px">
                    <thead>
                        <tr class="header">
                            <td align="center">EmpId</td>
                            <td align="center">Person Name</td>
                            <td align="center">Phone No.</td>
                            <td align="center">Email Id</td>
                            <td align="center">Department</td>
                            <td align="center">Office Location</td>
                            <td align="center">Designation</td>
                            <td align="center">Round 1 Score</td>
                            <td align="center">Round 1 Risk</td>
                            <td align="center">Category A</td>
                            <td align="center">Category B</td>
                            <td align="center">Category C</td>
                            <sec:authorize ifAnyGranted="ROLE_BF_CORPORATE_CUSTOMER_EDIT">
                                <td>&nbsp;</td>
                                <td>&nbsp;</td>
                            </sec:authorize>
                        </tr>
                    </thead>
                    <c:forEach items="${listCorporateData}" var="Item">
                        <tr>
                            <td align="center">${Item.employeeId}</td>
                            <td>${Item.name}</td>
                            <td align="center">${Item.phone}</td>
                            <td>${Item.email}</td>
                            <td>${Item.department}</td>
                            <td>${Item.officeLocation}</td>
                            <td>${Item.designation}</td>
                            <td align="center">${Item.scoreRound1}</td>
                            <td align="center">${Item.riskRound1}</td>
                            <td align="center">${Item.categoryA}</td>
                            <td align="center">${Item.categoryB}</td>
                            <td align="center">${Item.categoryC}</td>
                            <sec:authorize ifAnyGranted="ROLE_BF_CORPORATE_CUSTOMER_EDIT">
                                <td><a href="../corporate/editCorporateCustomerDetails.htm?corporateCustomerId=<c:out value="${Item.corporateCustomerId}"/>&paymentTypeId=${paymentTypeId}&customerName=${customerName}">Edit</a></td>
                                <td><label onclick="window.open('../corporate/editCorporateCustomer.htm?coCustomerId=<c:out value="${Item.corporateCustomerId}"/>','_blank','status=0, toolbar=0, location=0, menubar=0, directories=0, resizable=1, scrollbars=1, width=600, height=550');return false;">Calendar</label></td>
                            </sec:authorize>
                        </tr>
                    </c:forEach>
                </table>
                &nbsp;&nbsp;&nbsp;<c:out value="${fn:length(listCorporateData)}"/> <spring:message code="rowsFound"/>
            </div>
            <!--            <div style="float: left;">
                            <br/>
                            <table class="data_table" border="1px">
                                <thead>
                                    <tr class="header">
                                        <td align="center">Event ID</td>
                                        <td align="center">Event Description</td>
                                    </tr>
            <c:forEach items="${eventList}" var="Item">
                <tr>
                    <td align="center">${Item.eventId}</td>
                    <td align="center">${Item.eventDescription}</td>
                </tr>
            </c:forEach>
        </thead>
    </table>
</div>-->
        </div>
    </body>
</html>
